-
Notifications
You must be signed in to change notification settings - Fork 58
Query Service AIO #467
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Query Service AIO #467
Conversation
🌋 Here are results of SLO test for python-sync: |
b72d422
to
a5870d9
Compare
ff3ddcc
to
8f654cb
Compare
async for result_set in results: | ||
print(f"rows: {str(result_set.rows)}") | ||
|
||
await pool.retry_operation_async(callee) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to use execute_with_retries
?
8f654cb
to
52a6bfd
Compare
@@ -0,0 +1,143 @@ | |||
import asyncio |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename to _v2_asyncio?
async for result_set in results: | ||
print(f"rows: {str(result_set.rows)}") | ||
|
||
await pool.retry_operation_async(callee) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
execute_with_retries?
ydb/aio/query/session.py
Outdated
self._state.reset() | ||
self._state._change_state(QuerySessionStateEnum.CLOSED) | ||
except Exception: | ||
pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you need to change state of the session on exception?
Do you need same behaviour for sync method?
self._tx_state._change_state(QueryTxStateEnum.ROLLBACKED) | ||
return | ||
|
||
await self._ensure_prev_stream_finished() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The method override base method, but with other signature.
It is difference from sync class: sync class use method from base class.
What about do one of:
- Extract common part to base class and reuse it from both children
- Complete split method to sync and async - for same style.
Now I can fix bug in the base class and think about I fix the bug/change behaviour in both variants because it is base class. (Or forgot about async code at all).
Same for other methods from the base class.
@@ -58,7 +58,9 @@ async def _check_session_status_loop(self) -> None: | |||
self._state.reset() | |||
self._state._change_state(QuerySessionStateEnum.CLOSED) | |||
except Exception: | |||
pass | |||
if not self._state._already_in(QuerySessionStateEnum.CLOSED): | |||
self._state.reset() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Why do you need reset session state before set closed _state._state?
- When the session will be really closed (call
DeleteSession
and detach from attached stream?
Pull request type
Please check the type of change your PR introduces:
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Other information